import 'package:flutter/material.dart';

///
/// 显示状态的标签
///
class QStateTag extends StatelessWidget {
  final String title;
  final double fontSize;
  final Color titleColor;
  final Color bgColor;

  const QStateTag({
    Key? key,
    required this.title,
    this.fontSize = 14,
    this.titleColor = Colors.black,
    this.bgColor = Colors.black26,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {

    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
      decoration: BoxDecoration(
          color: bgColor.withOpacity(.1),
          borderRadius: BorderRadius.circular(4)),
      child: Text(
        title,
        maxLines: 1,
        overflow: TextOverflow.ellipsis,
        style: TextStyle(
          fontSize: fontSize,
          color: titleColor,
        ),
      ),
    );
  }
}
